<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%if(request.getAttribute("success")!=null && request.getAttribute("success")=="true"){ 
    	System.out.println(request.getAttribute("success"));
    }else{
    	System.out.println(request.getAttribute("success"));
    }
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>留言板</title>
	<link href="<%=request.getContextPath() %>/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<style type="text/css"> 
<!--
body,td,th {
	font-size: 9pt;
}
.border-l-b-r-t {
	BORDER-RIGHT: #cecfce 1px solid; BORDER-TOP: #cecfce 1px solid; BORDER-LEFT: #cecfce 1px solid; BORDER-BOTTOM: #cecfce 1px solid
}
.main_table{
      font-size:12px;
}
.main_table input{
   border:1px FF9900 solid;
   background:#f9b88a;
 
 
}
 
.main_table textarea{
   border:1px FF9900 solid;
   background:#f9b88a;
 
 
}
-->
</style>
 
<!-- 添加留言 -->
<script language="javascript"> 
function check()
{
	if (form1.messageSubject.value=="")
	{alert("主题不能为空！");
	form1.messageSubject.focus();
	return false;
	}
 
	if (form1.contactName.value=="")
	{alert("姓名不能为空！");
	form1.contactName.focus();
	return false;
	}
	
	if (form1.contactSex.value=="")
	{alert("性别不能为空！");
	form1.contactSex.focus();
	return false;
	}
	
	if (form1.contactEmail.value=="")
	{alert("Email不能为空！");
	form1.contactEmail.focus();
	return false;
	}
	
	if (form1.contactTel.value=="")
	{alert("电话不能为空！");
	form1.contactTel.focus();
	return false;
	}
	
	if (form1.messageContent.value=="")
	{alert("留言内容不能为空！");
	form1.messageContent.focus();
	return false;
	}
	return true;
}

function insert(){
	if(check()){
		document.form1.action = "MessageServlet.do?method=insert";
		document.form1.submit();
	}
}
</script>
<FORM name="form1" method="post" onSubmit="insert()">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
          <td height="42" align="left" >你现在的位置：
          <a href="index.asp">首页</a> &gt;&gt; 留言板</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
  </table>   
<TABLE width="95%" border="0"  align="center" cellPadding="2" cellSpacing="0" class="main_table">

      <TR>
        <TD noWrap align=right width="7%">主题： </TD>
        <TD width="93%"><INPUT name=messageSubject class=inputstyle id="messageSubject">
            <font color="#FF0000">*</font></TD>
      </TR>
      <TR>
        <TD noWrap align=right width="7%">姓名： </TD>
        <TD width="93%"><INPUT name=contactName class=inputstyle id="contactName">
            <font color="#FF0000">*</font></TD>
      </TR>
      <TR>
        <TD noWrap align=right width="7%">性别： </TD>
        <TD width="93%"><INPUT name=contactSex class=inputstyle id="contactSex">
            <font color="#FF0000">*</font></TD>
      </TR>
      <TR>
        <TD noWrap align=right width="7%">Email： </TD>
        <TD width="93%"><INPUT 
                      name=contactEmail class=inputstyle id="contactEmail"></TD>
      </TR>
      <TR>
        <TD noWrap align=right width="7%">电话： </TD>
        <TD width="93%"><INPUT 
                      name=contactTel class=inputstyle id="contactTel">
       </TD>
      </TR>
      <TR>
        <TD noWrap align=right width="7%" height=92>内容： </TD>
        <TD width="93%"><TEXTAREA name=messageContent cols=50 rows=6 id="messageContent"></TEXTAREA>
            <font color="#FF0000">*</font></TD>
      </TR>
      <TR>
        <TD noWrap align=right height=36></TD>
        <TD><INPUT type=submit value=提交留言 name=Submit></TD>
      </TR>
</TABLE>
  </FORM>
</body>
</html>